using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace OpenRay
{
	//Immutable Class
	public class FlatTriangleGeometry : TriangleGeometry
	{		
		public FlatTriangleGeometry ( IList<Point> v, IList<Vector> n, IList<Material> m )
			: base( v, n, m )
		{
			Debug.Assert( v.Count == 3, "FlatTriangleGeometry: Not enough vertices provided" );
			Debug.Assert( n.Count == 1, "FlatTriangleGeometry: No normal provided" );
			Debug.Assert( m.Count == 1, "FlatTriangleGeometry: No material provided" );
		}
		
		public override Material Material (Point modelHit, InterpolationData interpolation)
		{
			return materials[0];
		}
		
		public override Vector Normal (Point modelHit, InterpolationData interpolation)
		{
			return normals[0];
		}
	}
}

